package com.elguile.laptop.vista;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import javax.swing.JTextField;
import javax.swing.JLabel;
import java.awt.FlowLayout;
import javax.swing.JButton;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.table.DefaultTableModel;


public class PanListaVentas extends JPanel {

	private static final long serialVersionUID = 1L;
	private JTextField textField;
	private JTextField textField_1;
	private JTextField textField_2;
	private JTable table;

	
	public PanListaVentas() {
		setLayout(new BorderLayout(0, 0));
		
		JPanel panel = new JPanel();
		FlowLayout flowLayout = (FlowLayout) panel.getLayout();
		flowLayout.setAlignment(FlowLayout.LEFT);
		add(panel, BorderLayout.NORTH);
		
		JLabel label = new JLabel("Codigo");
		panel.add(label);
		
		textField = new JTextField();
		textField.setText("0000001");
		textField.setEnabled(false);
		textField.setColumns(10);
		panel.add(textField);
		
		JLabel label_1 = new JLabel("fecha");
		panel.add(label_1);
		
		textField_1 = new JTextField();
		textField_1.setText("15/12/12");
		textField_1.setEnabled(false);
		textField_1.setColumns(10);
		panel.add(textField_1);
		
		JLabel label_2 = new JLabel("Usuario");
		panel.add(label_2);
		
		textField_2 = new JTextField();
		textField_2.setText("Roberto");
		textField_2.setEnabled(false);
		textField_2.setColumns(10);
		panel.add(textField_2);
		
		JButton btnBuscar = new JButton("Buscar");
		panel.add(btnBuscar);
		
		JScrollPane scrollPane = new JScrollPane();
		add(scrollPane, BorderLayout.CENTER);
		
		table = new JTable();
		scrollPane.setViewportView(table);
		table.setModel(new DefaultTableModel(
			new Object[][] {
				{"0000001", "roberto", "15/12/12"},
			},
			new String[] {
				"New column", "New column", "New column"
			}
		));

	}

}
